﻿<!DOCTYPE html>
<html lang="en">
<head>
    <title>宾果高校</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <link rel="stylesheet" href="../css/bootstrap.min.css">
    <link rel="stylesheet" href="../css/style.css">
    <link rel="stylesheet" href="../css/sweetalert.min.css" />
    <script src="../js/jquery-1.12.2.min.js"></script>
    <script src="../js/common.js"></script>
    <script src="../js/layer.js"></script>
    <script src="../js/angular.min.js"></script>
    <script src="../js/Controller.js"></script>
    <script src="../js/sweetalert.min.js"></script>
</head>
<body id="bodyContent">
    <div id="searchPage"></div>
    <div style="margin-top: 20px;" class="main">
        <div ng-app="myApp" class="wrap">
            <div class="panel panel-default">
                <div class="panel-body">
                    <div class="togglebar">
                        <ul class="nav nav-tabs nav-justified">
                            <li class="active"><a id="showBox1">智慧搭配企业</a></li>
                            <li><a id="showBox2">自选企业</a></li>
                        </ul>
                    </div>
                    <div style="margin-top: 5px;"></div>
                    <div ng-controller="sysChooseEntrCtrl" id="box1">
                        <table class="table table-hover">
                            <tr>
                                <td>社团活动书名称</td>
                                <td>活动书发布时间</td>
                                <td>邀请的企业名称</td>
                                <td>企业赞助书</td>
                                <td>邀请状态</td>
                                <td>邀请时间</td>
                                <td>确定合作</td>
                                <td>拒绝邀请</td>
                            </tr>
                            <tr ng-repeat="x in names">
                                <td>{{x.ProItem.ProjectSelf.ProjectName}}</td>
                                <td>{{x.ProItem.ProjectSelf.CreateTime|date:'yyyy-MM-dd'}}</td>
                                <td>{{x.Company.CompanyName}}</td>
                                <td><a href="#" tag="{{x.ProjectNO}}" onclick="View(this)">{{x.ProjectName}}</a></td>
                                <td>{{x.ProItem.Status|checkProjectItemStatus}}</td>
                                <td>{{x.ProItem.CreateTime|date:'yyyy-MM-dd'}}</td>
                                <td>
                                    <button type="button" class="btn btn-default btn-xs" tag="{{x.ProjectNO}}" tagroleid="{{x.ProItem.IntentionRoleNO}}" tagconid="{{x.ProItem.IntentionContactNO}}" onclick="Go(this, 'ok')">确定</button>
                                </td>
                                <td>
                                    <button type="button" class="btn btn-default btn-xs" tag="{{x.ProjectNO}}" tagroleid="{{x.ProItem.IntentionRoleNO}}" tagconid="{{x.ProItem.IntentionContactNO}}" onclick="Go(this, 'cancel')">确定</button>
                                </td>
                            </tr>
                        </table>
                    </div>
                    <div ng-controller="selfChooseEntrCtrl" id="box2">
                        <table class="table table-hover">
                            <tr>
                                <td>企业赞助书的活动名称</td>
                                <td>企业名称</td>
                                <td>企业地区</td>
                                <td>企业网址</td>
                                <td>企业类别</td>
                                <td>企业赞助书</td>
                                <td>联系结果</td>
                                <td>联系时间</td>
                            </tr>
                            <tr ng-repeat="x in names">
                                <td>{{x.ProjectName}}</td>
                                <td>{{x.Company.Name}}</td>
                                <td>{{x.Company.Address}}</td>
                                <td>{{x.Company.Web}}</td>
                                <td>{{x.Company.Type}}</td>
                                <td><a href="#" tag="{{x.ProjectNO}}" onclick="View(this)">{{x.ProjectName}}</a></td>
                                <td>{{x.ProItem.Status|checkProjectItemStatus}}</td>
                                <td>{{x.ProItem.CreateTime|date:'yyyy-MM-dd'}}</td>
                            </tr>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
</html>
<script>

    $("#searchPage").load("header.html", function () {
        SetCss("Act");
    });

    function View(obj) {

        var id = $(obj).attr("tag");

        layer.ready(function () {

            layer.open({
                type: 2,
                title: '宾果高校',
                fix: false,
                shadeClose: true,
                maxmin: false,
                area: ['1000px', '500px'],
                content: 'Message.html?mode=Books&id=' + id,
                end: function () {

                }
            });
        });
    }

    function AfteAjax(ctx) {

        if (ctx == "" || ctx == null) {
            window.location = "../login.html";
            return;
        }

        window.location = window.self;
    }

    function Go(obj, type) {
        var id = $(obj).attr("tag");
        var roleID = $(obj).attr("tagRoleID");
        var conID = $(obj).attr("tagconid");

        switch (type) {
            case "ok":
                common.commonAjax({ type: 'Get', url: '../api/project/UpdateItemStaus?type=ok&id=' + id + "&roleID=" + roleID + "&conID=" + conID, sMethod: AfteAjax, alert: true, loadingCtrl: $("#bodyContent") });
                break;
            case "cancel":
                common.commonAjax({ type: 'Get', url: '../api/project/UpdateItemStaus?type=cancel&id=' + id + "&roleID=" + roleID + "&conID=" + conID, sMethod: AfteAjax, alert: true, loadingCtrl: $("#bodyContent") });
                break;
        }
    }

</script>